#pragma once
#ifndef WORKCELL
#define WORKCELL

#include <vector>
#include <map>
#include <string>
#include <list>

enum CellState
{
	CELL_INITIALIZE,
	CELL_WAITING_WORKING,
	CELL_WORKING,
	CELL_WORK_FINISHED,
	CELL_WORK_ERROR,
	CELL_DIE
};

class Cell
{
public :
	Cell(){}
	virtual ~Cell(){}
public :
	virtual void SetMutithreadModeOff(){}
	virtual bool OnInit(){return true;}
	virtual bool OnWork(){return true;}
	virtual bool OnWorkFinished(){return true;}
	virtual bool OnUpdate(double NowTime,double PastTime){return true;}	
	virtual int GetCellState(){return 0;}
	virtual bool Release(){return true;}
protected :
	CellState m_State;
	bool m_Multithread_Mode;
};

typedef std::vector<Cell*> CELL_VECTOR;
typedef Cell* CELL_HANDLE;
typedef std::map<std::string,Cell*> CELL_HANDLE_MAP;
typedef std::list<CELL_HANDLE> CELL_LIST;

class CellManager
{
public :
	CellManager(){}
	~CellManager(){}
public :
	bool Initialize(){return true;}
	void UpdateCells(){}

};

#endif